import React, { useEffect } from 'react'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import routeConfig from './router'
import useChinaAreasStore from '@/store/chinaAreas'
import './assets/style/App.scss'

const router = createBrowserRouter(routeConfig)

export default function App() {
  const { fetchChinaAreas } = useChinaAreasStore()
  useEffect(() => {
    fetchChinaAreas()
  }, [])
  return (
    <div className="main">
      <RouterProvider router={router} />
    </div>
  )
}
